import { Model, DataTypes, Op } from 'sequelize';
import Enumerable from 'linq';
import SequelizeClient from '../sequelizeclient';
import { Subject } from './Subject';
let sequelize = SequelizeClient.getInstance();

//凭证明细表
export class VoucherDetail extends Model {}

const init = () => {
  VoucherDetail.init(
    {
      earlyStage: DataTypes.DECIMAL, //期初金额
      abstract: DataTypes.STRING, //描述
      subjectName: DataTypes.STRING, //科目名称
      subjectCode: DataTypes.STRING, //科目code
      debtorAmount: DataTypes.DECIMAL, //借
      lenderAmount: DataTypes.DECIMAL, //贷
      sort: DataTypes.INTEGER, //排序
      subjectDirection: DataTypes.INTEGER, //借贷方向  0  借   1  贷
    },
    { sequelize, modelName: 'voucherDetail' },
  );
};

export default { init };
